<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<title>H+ 后台主题UI框架 - 数据表格</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description"
	content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

<link rel="shortcut icon" href="${ctx}/favicon.ico">
<link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">

<!-- Data Tables -->
<link href="${ctx}/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

<link href="${ctx}/css/animate.css" rel="stylesheet">
<link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
<!-- 全局js -->
<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 引入分页插件  -->
<script src="${ctx}/js/bootstrap-paginator.js"></script>

<script src="${ctx}/js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="${ctx}/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${ctx}/js/plugins/dataTables/dataTables.bootstrap.js"></script>

<!-- 引入日历插件js文件 -->
<script src="${ctx}/js/plugins/layer/laydate/laydate.js"></script>

<!-- 引入弹框插件 layer  -->
<script src="${ctx}/js/plugins/layer/layer.min.js"></script>

<!-- 引入 Jquery.validate.js 表单验证框架 -->
<script src="${ctx}/js/jquery.validate.min.js"></script>
<script src="${ctx}/js/messages_zh.min.js"></script>

<!-- 自定义js -->
<script src="${ctx}/js/content.js?v=1.0.0"></script>
<script src="${ctx}/task/DelayTaskApply.js"></script>

<script type="text/javascript">			
	function updateDetail(taskId){						  
		window.location.href="${ctx}/ChangeDelayTask.oa?id="+taskId;
	}
	function checkDetail(taskId){
		window.location.href="${ctx}/DelayTaskDetail.oa?id="+taskId;
	}
	function applyDelay(){
		window.location.href="${ctx}/task/IssuedTask.jsp";
	}
	
</script>

<script>
	function deleteDelay(){
		var ids=[];
		$("input:checked").each(function(){ 
	        ids.push($(this).val());
	     });
		if (ids.length != 0){
			alert("确认要删除吗？");
			var delIds=ids.join(","); 
			$.ajax({
				method: "get",
				url: getContextPath()+"/DelayTaskApply.oa",
				data: {cmd: 'del' , ids: delIds}, 
				contentType: "text/html;charset=utf-8",
				dataType: "html",
				success: function (data) {
					if (data.code == 1){
						alert(data.msg);
					} else {
						alert(data.msg);
					}
					getPage();
				}
			},"json")
		}
	}
</script>
				

</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
				
					<div class="ibox-title">

						<div class="ibox-tools">
							<a class="collapse-link">
								<i class="fa fa-chevron-up"></i>
							</a>
							<a class="dropdown-toggle" data-toggle="dropdown" href="table_data_tables.html#">
								<i class="fa fa-wrench"></i>
							</a>
							<ul class="dropdown-menu dropdown-user">
								<li><a href="table_data_tables.html#">选项1</a></li>
								<li><a href="table_data_tables.html#">选项2</a></li>
							</ul>
							<a class="close-link">
								<i class="fa fa-times"></i>
							</a>
						</div>
					</div>
					
					<div class="ibox-content">
						<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper form-inline" role="grid">
							<div class="row">
								<div class="col-sm-5">
								
									<!-- 增加 -->
									<div >
										<div class="dataTables_length" id="DataTables_Table_0_length">
											<label>
												<button class="btn btn-sm btn-primary" onclick="applyDelay()" title="申请延期" style="margin-right:10px">申请延期</button>
											</label>
										</div>
									</div>									
									<!-- 删除 -->
									<div >
										<div class="dataTables_length" id="DataTables_Table_0_length" style="margin-right:10px">
											<label>
												<button class="btn btn-sm btn-danger" onclick="deleteDelay()" id="delDelay" title="删除" style="margin-right:10px">删除</button>
											</label>
										</div>
									</div>
									
									<!-- PageSize -->
									<div>
										<div class="form-group">
											<div class="input-group">
												<select id="pageSize" data-placeholder="每页记录数" class="chosen-select" style="width:100px;" tabindex="2">
													<option value="">每页记录数</option>
													<option id="10" value="10" hassubinfo="true">10条</option>
													<option id="25" value="25" hassubinfo="true">25条</option>
													<option id="50" value="50" hassubinfo="true">50条</option>
													<option id="100" value="100" hassubinfo="true">100条</option>
												</select>
											</div>
										</div>
									</div>
									
								</div>

								<div class="col-sm-7">
									<div id="DataTables_Table_0_filter" class="dataTables_filter">
										<label>
											查找：
											<input id="keyWord" class="form-control input-sm" aria-controls="DataTables_Table_0" type="search" placehoder="关键字最少需要两个字符">
										</label>
									</div>
								</div>
							</div>
							
							<table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
								<thead>
									<tr role="row">
										<td class="sorting_asc" tabindex="0" >
											<div>
												<input id="delay0" name="" type="checkbox" value="">
											</div>
										</td>
										<th class="sorting_asc" tabindex="0" >申请人</th>
										<td class="sorting_asc" tabindex="0" >延期到(日期)</td>
										<td class="sorting_asc" tabindex="0" >申请原因</td>
										<td class="sorting_asc" tabindex="0" >批复状态</td>
										<td class="sorting_asc" tabindex="0" >批复时间</td>
										<td class="sorting_asc" tabindex="0" >批复人</td>
										<td class="sorting_asc" tabindex="0" colspan="2">操作</td>
									</tr>
								</thead>
								<tbody id="delayList">
									<tr></tr>
								</tbody>
							</table>
							
							<div class="row">
								<div class="col-sm-6">
									<div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">
										<div>
											<a>当前第<b id="currentPage"></b>页, </a>
											<a>共<b id="totalCount"></b>条信息, </a>
											<a>共<b id="totalPage"></b>页</a>
										</div>
									</div>
								</div>
								<div class="col-sm-6">
									<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
										<ul id="pageDiv" class="pagination">
											<li class="paginate_button previous" aria-controls="DataTables_Table_0" tabindex="0" id="DataTables_Table_0_previous">
												<a id="formerPage" href="#">上一页</a>
											</li>
											<li class="paginate_button " aria-controls="DataTables_Table_0" tabindex="0">
												<a id="firstpage" href="#">第<b id="p1"></b>页</a>
											</li>
											<li class="paginate_button " aria-controls="DataTables_Table_0" tabindex="0">
												<a id="secondpage" href="#">第<b id="p2"></b>页</a>
											</li>
											<li class="paginate_button " aria-controls="DataTables_Table_0" tabindex="0">
												<a id="thirdpage" href="#">第<b id="p3"></b>页</a>
											</li>
											<li class="paginate_button " aria-controls="DataTables_Table_0" tabindex="0">
												<a id="fourthpage" href="#">第<b id="p4"></b>页</a>
											</li>
											<li class="paginate_button next" aria-controls="DataTables_Table_0" tabindex="0" id="DataTables_Table_0_next">
												<a id="nextPage" href="#">下一页</a>
											</li>
										</ul>
									</div>
								</div>
							</div>
						</div>
					</div>
				
				</div>
			</div>
		</div>
	</div>

</body>

</html>
